<?php
include_once 'common.inc.php';

load()->func('tpl');

if($operation == 'display'){
    
}

elseif($operation == 'post'){
    
    if($_W['isajax']){
        $data = array();
        
        if(!empty($_GPC['avatar'])){
            $data['avatar'] = $_GPC['avatar'];
        }
        if(!empty($_GPC['realname'])){
            $data['realname'] = $_GPC['realname'];
        }
        if(!empty($_GPC['nickname'])){
            $data['nickname'] = $_GPC['nickname'];
        }
        if(!empty($_GPC['mobile'])){
            $data['mobile'] = $_GPC['mobile'];
        }
        if(!empty($_GPC['gender'])){
            $data['gender'] = $_GPC['gender'];
        }
        if(!empty($_GPC['provance'])){
            $data['resideprovince'] = $_GPC['provance'];
        }
        if(!empty($_GPC['city'])){
            $data['residecity'] = $_GPC['city'];
        }
        if(!empty($_GPC['area'])){
            $data['residedist'] = $_GPC['area'];
        }
        if(!empty($_GPC['address'])){
            $data['address'] = $_GPC['address'];
        }
        if(!empty($data)){
            pdo_update("mc_members",$data,array('uid'=>$uid));
        }
        
        show_json(1,$_GPC);
    }
    
    message("更新资料成功！",$this->createMobileUrl('index'),"success");
}

include $this->template('info');